import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        Scanner s=new Scanner(System.in);

        int n=s.nextInt();
        int[] a=new int[n];
        int[] b=new int[n];
        int count=0;
        for (int i = 0; i < n; i++) {
            a[i]=s.nextInt();
        }

        for (int i = 0; i < n; i++) {
            int ifs=1;
            for (int j = 0; j < count; j++) {
                if(a[i]==b[j]){
                    ifs=0;
                }
            }
            if(ifs==1) {
                b[count++] = a[i];
            }
        }

        Arrays.sort(b,0,count);
        System.out.println(count);
        for (int i = 0; i < count; i++) {
            System.out.printf(b[i]+" ");
        }





    }
}